<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/commons/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<%@ include file="/WEB-INF/jsp/commons/meta.jsp"%>
<title>我要积分</title>
</head>
<body>
	<%@ include file="/WEB-INF/jsp/commons/header.jsp"%>
	<div role="main" data-role="content" data-form="ui-body-a" data-theme="a" class="ui-content ui-body-a">
		<span>
			<a href="#" data-role="button" data-icon="bars" data-iconpos="notext" data-theme="b" data-iconshadow="false" data-inline="true">Bars</a>
			我要积分
		</span>
		<c:if test="${qrMap.m == null}">
			<form action="${ctx }/points/charge.htm" data-ajax="false" method="GET">
				<table style="width: 100%;">
					<tr>
						<td>积分码</td>
						<td><input type="text" name="icode" /></td>
					</tr>
					<tr>
						<td></td>
						<td><input type="submit" data-role="button" value="查询"></td>
					</tr>
					<c:if test="${qrMap != null }">
						<tr>
							<td></td>
							<td style="text-align:center;color:red;">${qrMap.iCode }无效积分码！</td>
						</tr>
					</c:if>
				</table>
			</form>
		</c:if>
		<c:if test="${qrMap.m != null}">
			<form action="${ctx }/points/charge.htm" data-ajax="false" method="POST">
				<input type="hidden" name="qrId" value="${qrMap.q.id }">
				<input type="hidden" name="qrPoint" value="${qrMap.m.point }">
				<input type="hidden" name="iCode" value="${qrMap.iCode }">
				<table>
					<tr>
						<td>积分码</td>
						<td>${qrMap.iCode }</td>
					</tr>
					<tr>
						<td>商品名称</td>
						<td>${qrMap.m.name }</td>
					</tr>
					<tr>
						<td>生产日期</td>
						<td><fmt:formatDate value="${qrMap.g.produceDate }" /></td>
					</tr>
					<tr>
						<td>保质期</td>
						<td>${qrMap.m.shelflife } 月</td>
					</tr>
					<tr>
						<td>可积分数</td>
						<td>${qrMap.m.point } 分</td>
					</tr>
					<tr>
						<td><a href="${ctx }/points/charge.htm">返回查询</a></td>
						<td><input type="submit" value="提交积分"></td>
					</tr>
				</table>
			</form>
		</c:if>
	</div>
	<%@ include file="/WEB-INF/jsp/commons/footer.jsp"%>
</body>
</html>